<?php
/*
Author: Rudolf Achter
Description: Startseite fuer den Loadbalancer Admin
*/
define("debug",false);
include "./include/config.inc.php";
#include "./include/lb_get_info.inc.php";

$o_db=new class_db_mysql();
$o_db->id="community_list_comments";
$o_db->db_connect(DB_SERVER,DB_DB,DB_USER,DB_PW);
$o_db->rows_per_page=5;

if($_GET["element"]=="community_list_comments" and isset($_GET["page"]))
	$o_db->page=$_GET["page"];

$query="SELECT *
FROM wlp_forum
JOIN wlp_comments ON wlp_comments.forum_id = wlp_forum.id
WHERE wlp_forum.id = '".mysql_escape_string($_GET["id"])."'
ORDER BY wlp_comments.time asc";
$data=$o_db->db_query($query);

//echo $o_db->query;

$pageswitcher = new class_page_switcher($o_db->pages,$o_db,"span");
$pageswitcher->jquery_switch="community_comments_".$_GET["id"];
//$html_menu_content.=$pageswitcher->get_html();

$o_error_pool->get_errors_html();
if($data)
{
?>
<table width="100%">
<tr>
	<td colspan="2">
<?php echo $pageswitcher->get_html()?>
	</td>
</tr>
<?php

foreach($data as $row)
{
?>

<tr>
	<td>
		Author
	</td>
	
	<td>
		<p>
		<?php
		$span = new class_span($row["text"]);
		echo $span->fulltext($row["text"]);
		?>
		</p>
	</td>
</tr>

<?php
}
?>
</table>				
				
<?php
}
?>